/*
 * app_indicator.c
 *
 *  Created on: Oct 10, 2013
 *      Author: Omar Sevilla
 */

#include "derivative.h"
#include "stdtypedef.h"
#include "app_indicator.h"

void init_indicator(void){
	//Set Clock Ports
	SIM_SCGC5 |= SIM_SCGC5_PORTB_MASK;
	
	//PORTB_PCR9 = PORT_PCR_MUX(1); 	//Set PTB9 as Output(Alternative 1)
	PORTB_PCR10 = PORT_PCR_MUX(1); 	//Set PTB10 as Output(Alternative 1)
	
	//GPIOB_PCOR |= INDICATOR1_SHIFT;
	GPIOB_PCOR |= INDICATOR2_SHIFT;
	
	//GPIOB_PDDR |= INDICATOR1_SHIFT;	//Set Indicator 1 Pin as Output
	GPIOB_PDDR |= INDICATOR2_SHIFT;	//Set Indicator 2 Pin as Output
}

void set_indicator(T_UBYTE T_UBYTE_IndicatorValue){
	switch(T_UBYTE_IndicatorValue){
	case OFF:
		SET_INDICATOR1;
		CLEAR_INDICATOR2;
		break;
	case ANALOG_MODE:
		SET_INDICATOR2;
		CLEAR_INDICATOR1;
		break;
	case SECUENCIAL_MODE:
		SET_INDICATOR1;
		SET_INDICATOR2;
		break;
	default:
		break;
	}
}
